<!--
 * @Description: 
 * @Author: Cxy
 * @Date: 2025-08-20 12:47:56
 * @LastEditors: Cxy
 * @LastEditTime: 2025-08-20 12:50:34
 * @FilePath: \xy-admin\docs\elecomponents\form\cascader\lanjiazai.vue
-->
<script lang="ts" setup>
import { reactive } from 'vue'
const formList = reactive<FormList>([
  {
    label: '懒加载级联选择器',
    prop: 'cascader4',
    type: 'cascader',
    props: {
      lazy: true,
      lazyLoad: (node, resolve) => {
        const { level } = node
        setTimeout(() => {
          const nodes = Array.from({ length: level + 1 }).map((_, i) => ({
            value: Date.now(),
            label: `选项-${i + 1}`,
            leaf: level >= 2
          }))
          resolve(nodes)
        }, 1000)
      }
    }
  }
])
const submitForm = (formData: any) => {
  console.log(formData)
}
</script>
<template>
  <XyAddForm isCard :formList="formList" @submit-form="submitForm" />
</template>
